
{{set . "title" "编辑个人信息"}}
{{template "header.html" .}}

<div class="container fixed">
	<div class="section span9">
		<div class="page-header">
			<h2>{{.title}}</h2>
		</div>

		{{template "flash.html" .}}

		<form action="{{url "User.Edit"}}" method="post" enctype="multipart/form-data">
			<input type="hidden" name="csrf_token" value="{{ .csrf_token }}" />

			<ul class="nav nav-tabs">
				<li class="active">
					<a href="#">头像设置</a>
				</li>
			</ul>
			<ul class="thumbnails">
				{{range .avatars}}
				<li>
					<label>
						<img class="img-rounded" src="{{$.qiniuDomain}}/public/img/{{.}}">
						<input style="margin-left: 16px;" type="radio" name="avatar" value="{{.}}"{{if $.user.IsDefaultAvatar .}} checked{{end}}>
					</label>
				</li>
				{{end}}
			</ul>

			<hr>上传头像

			{{with $field := field "image" .}}
			<div class="control-group">
				{{if $.user.Avatar}}
					<img class="img-rounded" src="{{$.qiniuDomain}}{{$.user.AvatarImgSrc}}">
				{{end}}
				<div class="controls">
					<div class="uploader" id="uniform-fileInput">
						<input type="file" name="{{$field.Name}}" class="input-file uniform_on" id="{{$field.Name}}">
					</div>
					<span class="text-error">{{$field.Error}}</span>
				</div>
			</div>
			{{end}}

			<hr>
			<div class="control-group">
				<div class="controls">
					<button type="submit" class="btn btn-primary">保存头像</button>
				</div>
			</div>
		</form>
	</div>
</div>

{{template "check_image_js.html" .}}

{{template "footer.html" .}}
